import { COMMENT_PROD, COMMENT_PROD_PAGE } from '../constants/comment'

const INITIAL_STATE = {
    prodCommData: [],
    prodCommPage: {}
}

export default function comment(state = INITIAL_STATE, action) {
    switch (action.type) {
        case COMMENT_PROD: {
            return {
                ...state,
                prodCommData: action.payload
            }
        }
        case COMMENT_PROD_PAGE: {
            return {
                ...state,
                prodCommPage: action.payload
            }
        }
        default: {
            return state
        }
    }
}